# -*- coding: utf-8 -*-

from django.db import models
from datetime import datetime

# 教练type=0
class UserInfo(models.Model):
    user_id = models.AutoField('用户信息表id',primary_key=True,)
    open_id = models.CharField('openid',max_length=64,editable=True,)
    avatar = models.CharField('头像',max_length=255,editable=True,default='-')
    nickname = models.CharField('昵称',max_length=64,editable=True,default='boy')
    real_name = models.CharField('真实姓名',max_length=64,editable=True)
    tel = models.CharField('手机号',max_length=20,editable=True,)
    user_type = models.CharField('type',max_length=2,editable=True,default='1')
    advantage = models.CharField('擅长项目',max_length=30,editable=True,null=True,default='-')
    short_introduce = models.CharField('一句话介绍',max_length=30,editable=True,null=True,default='-')
    detail_introduce = models.CharField('详细介绍',max_length=800,editable=True,null=True,default='-')
    status = models.CharField('status',max_length=2,editable=True,default='0')
    state = models.CharField('STATE',max_length=2,editable=True,default='1') 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'用户与教练基本信息表'
        verbose_name_plural = u'用户与教练基本信息表'
        db_table = 'USER_INFO'

class AppointInfo(models.Model):
    appoint_id = models.AutoField('预约信息表id',primary_key=True)
    user_id = models.CharField('用户id',max_length=64,editable=True)
    scheme_id = models.CharField('课程id',max_length=64,editable=True)
    start_time = models.DateTimeField('开始时间',max_length=20,editable=True)
    status = models.CharField('status',max_length=2,editable=True)
    state = models.CharField('STATE',max_length=2,editable=True) 
    count = models.IntegerField('预约次数',editable=True)
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'预约信息表'
        verbose_name_plural = u'预约信息表'
        db_table = 'APPOINT_INFO'

class SchemeInfo(models.Model):
    scheme_id = models.AutoField('课程信息表id',primary_key=True)
    scheme_name = models.CharField('科目名称',max_length=20,editable=True)
    start_time = models.DateTimeField('开始时间',max_length=20,editable=True)
    continue_time = models.CharField('持续时间',max_length=3,editable=True)
    position = models.CharField('地点',max_length=30,editable=True)
    max_people = models.CharField('人数上限',max_length=4,editable=True)
    user_id = models.CharField('教练id',max_length=64,editable=True,)
    introduce = models.CharField('课程介绍',max_length=564,editable=True,)
    scheme_type = models.CharField('课程类型',max_length=64,editable=True,)
    status = models.CharField('status',max_length=2,editable=True,)
    state = models.CharField('STATE',max_length=2,editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'课程信息表'
        verbose_name_plural = u'课程信息表'
        db_table = 'SCHEME_INFO'

class packageInfo(models.Model):
    package_id = models.AutoField('套餐卡信息id',primary_key=True)
    package_name = models.CharField('卡名',max_length=255,editable=True,default=1)
    league_amount = models.CharField('团课次数',max_length=7,editable=True,)
    private_amount = models.CharField('私教次数',max_length=7,editable=True,)
    benner = models.CharField('背景图片',max_length=64,editable=True,)
    introduce = models.CharField('套餐介绍',max_length=300,editable=True,) 
    price = models.IntegerField('价格',editable=True,)
    status = models.CharField('status',max_length=2,editable=True,)
    state = models.CharField('STATE',max_length=2,editable=True,) 
    valid_days = models.IntegerField('有效天数',editable=True)
    count = models.IntegerField('预约次数',editable=True)
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'套餐卡信息表'
        verbose_name_plural = u'套餐卡信息表'
        db_table = 'PACKAGE_INFO'


class PayLog(models.Model):
    pay_id = models.AutoField('支付记录id',primary_key=True)
    user_id = models.CharField('支付用户id',max_length=64,editable=True,)
    package_id = models.CharField('套餐卡信息id',max_length=64,editable=True,)
    amount = models.CharField('数量',max_length=3,editable=True,default=1)
    price = models.CharField('价格',max_length=7,editable=True,)
    pay_type = models.IntegerField('支付类型',editable=True,)
    status = models.CharField('status',max_length=2,editable=True,)
    state = models.CharField('STATE',max_length=2,editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'支付记录表'
        verbose_name_plural = u'支付记录表'
        db_table = 'PAY_LOG'

class NewPayLog(models.Model):
    pay_id = models.AutoField('支付记录id',primary_key=True)
    user_id = models.IntegerField('支付用户id',editable=True,)
    package_id = models.IntegerField('套餐卡信息id',editable=True,)
    order_id = models.CharField('order_id',max_length=20,editable=True,) 
    amount = models.IntegerField('数量',editable=True,default=1)
    price = models.IntegerField('价格',editable=True,)
    status = models.IntegerField('status',editable=True,)
    state = models.IntegerField('STATE',editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'支付记录表'
        verbose_name_plural = u'支付记录表'
        db_table = 'NEW_PAY_LOG'

class user_package(models.Model):
    user_package_id = models.AutoField('用户套餐卡id',primary_key=True)
    user_id = models.CharField('用户信息id',max_length=10,editable=True,default=1)
    package_id = models.CharField('套餐卡信息id',max_length=10,editable=True,)
    league_amount = models.CharField('团课剩余次数',max_length=7,editable=True,)
    private_amount = models.CharField('私教剩余次数',max_length=7,editable=True,)
    status = models.CharField('status',max_length=2,editable=True,)
    pay_type = models.IntegerField('支付类型',editable=True,)
    state = models.CharField('STATE',max_length=2,editable=True,) 
    expire_time = models.DateTimeField('截止日期',max_length=64,editable=True,)
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'用户套餐卡表'
        verbose_name_plural = u'用户套餐卡表'
        db_table = 'USER_PACKAGE'

class used_log(models.Model):
    used_id = models.AutoField('使用情况id',primary_key=True)
    user_id = models.CharField('用户信息id',max_length=10,editable=True,default=1)
    user_package_id = models.CharField('用户套餐卡id',max_length=10,editable=True,)
    scheme_id = models.CharField('课程信息id',max_length=10,editable=True,)
    scheme_type = models.CharField('课程类型',max_length=7,editable=True,)
    status = models.CharField('status',max_length=2,editable=True,)
    state = models.CharField('STATE',max_length=2,editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'用户套餐卡使用情况表(log)'
        verbose_name_plural = u'用户套餐卡使用情况表(log)'
        db_table = 'USED_LOG'

class position_room(models.Model):
    position_room_id = models.AutoField('地点id',primary_key=True)
    position_room_name = models.CharField('地点',max_length=10,editable=True,default='四季酒店')
    introduce = models.CharField('地点介绍',max_length=3000,editable=True,)
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'地点表'
        verbose_name_plural = u'地点表'
        db_table = 'POSITION_ROOM'

class teacher_img(models.Model):
    teacher_img_id = models.AutoField('教练图片id',primary_key=True)
    user_id = models.IntegerField('教练id',editable=True)
    img_url = models.CharField('图片路径',max_length=644,editable=True)
    status = models.IntegerField('status',editable=True,)
    states = models.IntegerField('STATE',editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'教练图片表'
        verbose_name_plural = u'教练图片表'
        db_table = 'TEACHER_IMG'

class position_img(models.Model):
    position_img_id = models.AutoField('地点图片id',primary_key=True)
    position_room_id = models.IntegerField('地点id',editable=True)
    img_url = models.CharField('图片路径',max_length=644,editable=True)
    status = models.IntegerField('status',editable=True,)
    states = models.IntegerField('STATE',editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'地点图片表'
        verbose_name_plural = u'地点图片表'
        db_table = 'POSITION_IMG'

class user_base(models.Model):
    id = models.AutoField('地点图片id',primary_key=True)
    userName = models.CharField('地点id',max_length=100,editable=True)
    password = models.CharField('图片路径',max_length=100,editable=True)
    state = models.IntegerField('STATE',editable=True,) 
    create_time = models.DateTimeField('CREATE_TIME',auto_now_add=True,editable=False,)
    update_time = models.DateTimeField('UPDATE_TIME',auto_now=True,editable=False,)

    class Meta:
        managed = True
        app_label = 'doc'
        ordering = ('-create_time',)
        verbose_name = u'后台账号表'
        verbose_name_plural = u'后台账号表'
        db_table = 'USER_BASE'